package com.cskaoyan.dbutils;

import com.cskaoyan.connectionpool.opensource.DruidUtils;
import org.apache.commons.dbutils.QueryRunner;
import org.apache.commons.dbutils.ResultSetHandler;

import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 创建日期: 2022/08/29 09:56
 *
 * @author ciggar
 *
 * QueryRunner
 *
 * 执行Query方法
 */
public class Demo4 {

    public static void main(String[] args) throws SQLException {


        // 传入数据库连接池
        QueryRunner queryRunner = new QueryRunner(DruidUtils.getDataSource());

        Object object = queryRunner.query("select * from user where id = ?", new MyResultSetHandler(), 1004);

        System.out.println("object:" + object);


    }


}
